import { Image } from 'antd';
import { Component } from 'react';
import styles from './index.less';
import { ImageProps } from 'antd/lib/image';

/**
 * 设置占位图
 */
class CustomImage extends Component<ImageProps> {
  render() {
    return (
      <Image
        preview={false}
        fallback={require('../../assets/logo.svg')}
        placeholder={
          <img
            className={styles.placeholder}
            src={require('../../assets/logo.svg')}
          />
        }
        {...this.props}
      />
    );
  }
}

export default CustomImage;